﻿using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using ECommerce.Library.Web;
using AutoGear.BLL;

/// <summary>
/// Summary description for SitePrivateBasePage
/// </summary>
public class SitePrivateBasePage : PrivateBasePage
{
    public static string rootPath = string.Empty;

    private int _subCategoryId = 0;
    public int SubCategoryId
    {
        get { return this._subCategoryId; }
        set { this._subCategoryId = value; }
    }

    public SitePrivateBasePage()
    {
        //
        // TODO: Add constructor logic here
        //
    }

    protected override void OnPreInit(EventArgs e)
    {
        base.OnPreInit(e);
        Theme = "Default";
    }

    protected override void OnLoad(EventArgs e)
    {
        base.OnLoad(e);
        rootPath = Page.ResolveUrl("~");
        Title = SiteSettings.SiteName;
        if (!SessionManager.IsUserLoggedIn) {
            SessionManager.ReturnUrl = Page.Request.RawUrl ;
            Response.Redirect(AutoGear.BLL.CustomSiteMap.Login);
        }
    }
}
